/*
*	Sanity Checks
*	Written by Andrew Moore
*	Arctic Region Supercomputing Center (ARSC)
*	Created June 23, 2009
*	Last Revised October 15, 2009
*/


/*	Header Files		*/
#include "sanityChecks.h"
/*				*/
/*	Function Definitions	*/
bool fileExists(std::string strFileprogramName) // Makes sure the file we are loading exists
{
	struct stat stFileInfo;	// Structure that will hold the files statistics.
	bool existance;	// Will be used to tell the calling program whether the file exists or not. 
	int intStat;  // Holds the return value of the stat function, 0 if succesful, otherwise 1.

	// Attempt to get the file attributes
	intStat = stat(strFileprogramName.c_str(),&stFileInfo);
	
	if(intStat == 0) // File exists and is accessible.
		existance = true;
	else // File either does not exist or is otherwise inaccesible.
		existance = false;
	
	return(existance);
}


/*				*/
